\tracingonline=2
\tracingcommands=2
\tracingmacros=2
\tracingrestores=2
\batchmode

\catcode`{=1
\catcode`}=2
\catcode`$=3
\catcode`#=6
\catcode`@=11

\immediate\write-1{zz}
\immediate\write1{zz}
\immediate\write16{zz}

\immediate\openout1=write1.aux
\immediate\write1{zz}
\immediate\write1{ll}
\immediate\closeout1

\relax

\openin1=./write1.aux
\read1to\x \show\x
\read1to\x \show\x
\read1to\x \show\x
\closein1

\tracingcommands=0
\tracingmacros=0
\tracingrestores=0
\tracingonline=0
\newlinechar=`@
\immediate\write16{~aa}
\immediate\write16{~ee}
\message{~ff@}

\immediate\write17{~aa}
\immediate\write17{~ee}
\message{~ff@}

\immediate\write-1{~aa}
\immediate\write-1{~ee}
\message{~ff@}

% extension
\immediate\openout0=write2.
\immediate\closeout0

\immediate\openout0=./write3
\immediate\closeout0

\immediate\openout0=write4
\immediate\closeout0

\end

